A Practical Model for Predicting Esophageal Variceal Rebleeding in Patients with Hepatitis B-Associated Cirrhosis

Background Variceal rebleeding is a significant and potentially life-threatening complication of cirrhosis. Unfortunately, currently, there is no reliable method for stratifying high-risk patients. Liver stiffness measurements (LSM) have been shown to have a predictive value in identifying complications associated with portal hypertension, including first-time bleeding. However, there is a lack of evidence to confirm that LSM is reliable in predicting variceal rebleeding. The objective of our study was to evaluate the ability of generating a extreme gradient boosting (XGBoost) algorithm model to improve the prediction of variceal rebleeding. Methods This retrospective analysis examined a cohort of 284 patients with hepatitis B-related cirrhosis. XGBoost models were developed using laboratory data, LSM, and imaging data to predict the risk of rebleeding in the patients. In addition, we compared the XGBoost models with traditional logistic regression (LR) models. We evaluated and compared the two models using the area under the receiver operating characteristic curve (AUROC) and other model performance parameters. Lastly, we validated the models using nomograms and decision curve analysis (DCA). Results During a median follow-up of 66.6 weeks, 72 patients experienced rebleeding, including 21 (7.39%) and 61 (21.48%) patients who rebleed within 6 weeks and 1 year, respectively. In brief, the AUC of the LR models in predicting rebleeding at 6 weeks and 1 year was 0.828 (0.759–0.897) and 0.799 (0.738–0.860), respectively. In contrast, the accuracy of the XGBoost model in predicting rebleeding at 6 weeks and 1 year was 0.985 (0.907–0.731) and 0.931 (0.806–0.935), respectively. LSM and high-density lipoprotein (HDL) levels differed significantly between the rebleeding and nonrebleeding groups, with LSM being a reliable predictor in those models. The XGBoost models outperformed the LR models in predicting rebleeding within 6 weeks and 1 year, as demonstrated by the ROC and DCA curves. Conclusion The XGBoost algorithm model can achieve higher accuracy than the LR model in predicting rebleeding, making it a clinically beneficial tool. This implies that the XGBoost model is better suited for predicting the risk of esophageal variceal rebleeding in patients.


Introduction
Acute hepatitis B is a major health burden, with an estimated 240 million chronic carriers of hepatitis B virus (HBV) surface antigen (HBsAg) worldwide and 815,000 deaths annually due to its complications [1,2]. Cirrhosis is the end stage of various chronic liver diseases, and esophageal variceal bleeding in cirrhosis is the main life-threatening complication of the decompensated phase. However, frst variceal bleeding occurs at a rate of 10-15% per year, and recurrent bleeding occurs at a rate of up to 60% per year [3], which is enough to warrant attention to variceal rebleeding.
Tanks to advanced noninvasive approaches, such as transient elastography, it is possible to conveniently and efciently determine the degree of liver fbrosis in patients [4]. In addition, there was a good correlation between liver stifness measurements and portal hypertension [5,6]. Furthermore, portal hypertension is a consequence of cirrhosis and is an important determinant of the course and prognosis of esophageal varices [7,8]. However, there are still gaps in the use of noninvasive means to predict patients with hepatitis B cirrhosis experiencing recurrent bleeding.
Modern medicine faces the challenge of using available knowledge to solve clinical problems consisting of sophisticated data. Moreover, the interactions between independent risk factors are nonlinear, and it is relatively inaccurate to analyze the prognostic performance of different factors using traditional linear discriminations [9]. Extreme gradient boosting (XGBoost) is a machine learning technique with the remarkable features of efcient and fexible handling of missing data and combining weak prediction models into accurate prediction models [10]. Te algorithm relies on combining predictions from a collection of weak decision and regression trees, which are sequentially added to the model to maximize prediction performance and minimize model complexity. Te algorithm is based on predictions from a collection of weak decision and regression trees, and these results are added to the model to maximize prediction performance and minimize model complexity. However, the ability of the XGBoost algorithm in predicting variceal rebleeding in cirrhosis is not yet clear.
Te increase in the computing power of smart terminals and the spread of information technology has created the potential for using machine learning models in regular practice. Tis study aimed to construct an XGBoost model for predicting esophageal variceal rebleeding in cirrhosis and to compare it with the traditional logistic regression model. It also provides a preliminary insight into the clinical features of patients who may experience rebleeding.

Study Cohort.
Tis study was a retrospective study of patients with hepatitis B-related cirrhosis hospitalized at the First Afliated Hospital of Nanchang University between September 2017 and October 2020. Te inclusion criteria for patients were as follows: (1) those aged ≥18, (2) those with positive hepatitis B surface antigen and diagnosed with cirrhosis by liver biopsy or imaging examinations together with clinical features, (3) those who frst bled in the past and received secondary prevention of variceal rebleeding, (4) and those who had a liver transient elastography measurement before the next episode of variceal bleeding. Te exclusion criteria included the following: (1) those with a diagnosis of HCC at inclusion or during the frst 6 months of follow-up, (2) those with known HIV, (3) those whose frst bleeding is nonesophagogastric vein bleeding under digestive endoscopy, (4) those with history of liver transplantation, (5) those who had a combination with other types of liver disease, (6) the patient had a large amount of ascites that afects the performed liver stifness measurements, and (7) those who had severe heart and lung disease. Te treatment of the included patients was individualized according to the Baveno VII standards [11]. Te study protocol was approved by the Institutional Ethics Committee of the First Afliated Hospital of Nanchang University.

Secondary Prevention, Liver Stifness Measurement,
Clinical Data Collection, and Outcome. Specifc details of the secondary prevention practices, liver stifness measurements, and clinical data collection are provided in the supplementary materials (available here).
Te primary outcome was a rebleeding event due to esophageal variceal. Patient survival and special procedures such as TIPS will also be recorded during follow-up periods. Te longest follow-up period is 3 years.

Strategies for Model Development.
For traditional logistic regression models, we use univariate and multivariate logistic regressions to identify the modeling variables and construct nomograms from the variables. Constructing a nomogram is a method of visualizing the selected features, which intuitively displays the contribution level and mutual cumulative relationship of variables to the outcome and can predict the probability of the outcome. LR model evaluation is done using the area under ROC, C-index, and calibration curve.
Te selection of features for the XGBoost model was determined based on clinical importance, scientifc knowledge, and previous publications in similar articles. To prevent model overftting, patients in the cohort were randomly assigned to the derivation set in a ratio of 70%, and the remaining 30% of patients were randomly divided into the validation and test sets in a 1 : 1 ratio. Before constructing the XGBoost model, the data were normalized and the categorical variable data were processed using one-hot coding. Te XGBoost model contains various hyperparameters that need to be tuned to the dataset to improve its performance. We perform a grid search on these hyperparameters to fnd the best combination. To better explain the XGBoost model, the SHapley Additive exPlanations (SHAP) [12] score was estimated to explain the XGBoost predictions. SHAP plots are drawn to represent the contribution of individual predictors to the fnal model.
Finally, we use AUC, sensitivity, specifcity, accuracy, precision, recall, and F1 to evaluate model performance and compare between LR and XGBoost models. To identify the net beneft of both models in clinical practice, the LR and XGBoost models were evaluated using a clinical decision curve (CDA).

Statistical Analysis.
Continuous variables are shown as the mean and standard deviation (SD) or median and interquartile range (IQR), while categorical variables are shown as frequencies (%). We tested whether the explanatory variable had an interaction and found no signifcant interactions within the included variables. Student's t-tests or Mann-Whitney U-test were performed for group comparisons. Te diagnostic accuracy of rebleeding was assessed by receiver operating characteristic (ROC) analysis. Areas under the ROC curves (AUCs) were compared by the method of DeLong et al. All levels of signifcance were set at a two-sided 5% level. All analyses were performed using SPSS 25.0 IBM (IBM Corp., Armonk, NY, USA) and R 3.5.2 (R Project for Statistical Computing, Vienna, Austria). Te R statistical packages tidyverse, pROC, rms, compareGroups, caret, XGBoost, SHAPforXGBoost, and rmda were used to model construction and statistical analysis.

Baseline Characteristics.
A total of 284 patients with hepatitis B-related cirrhosis patients who received secondary prevention of esophageal variceal rebleeding and liver stifness measurement between 2017 and 2020 were included in this study. Figure 1 shows a fowchart depicting the subject selection procedure, and Table 1 shows the baseline characteristics of the cohort population.
In a median follow-up time of 66.6 weeks, 72 (25.4%) patients presented with endoscopically confrmed rebleeding. In the whole cohort, the majority were male patients, accounting for 68.7%. Teir liver stifness measurements and portal vein diameter were increased compared to the normal population with a median of 14.2 kPa, 1.5 cm. 98 patients, or 34.5% of the cohort, were not taking NSBB drugs because of poor adherence or drug intolerance. In terms of blood cell analysis, the mean values of hemoglobin, white blood cell count, and platelet count in the cohort were 99.4 g/L, 4.33 × 10 9 /L, and 93.3 × 10 9 /L, respectively. In terms of liver function assessment, the majority of patients had a Child--Pugh grade A, accounting for 68.7%. Child-Pugh grades B and C accounted for 26.4% and 4.9%, respectively. In addition, the median MELD score for this cohort of patients was 9.87.
Of the patients frst hospitalized, 118 patients had symptoms of hypovolemia that did not progress to nonshock and improved with rehydration. 6 patients presented with stage II or less hepatic encephalopathy and their symptoms were corrected before discharge. 5 patients presented with signs and symptoms of spontaneous peritonitis during hospitalization and confrmed by blood culture or laparotomy. 4 patients completed TIPS before rebleeding, and 1 patient underwent liver transplantation.

Clinical Baseline Comparison between 6 Weeks and 1
Year. To further investigate the diferences in baseline clinical characteristics between patients in the esophageal variceal rebleeding group and those in the nonrebleeding group, we compared the baseline diferences between patients at two-time points (Table 1). In terms of rebleeding within 6 weeks, clinical baseline variables such as patient follow-up time, liver stifness values, portal vein diameter, use of NSBB drugs, hemoglobin, platelet count, glutamate transaminase, alkaline phosphatase, glutamine aminotransferase, cholesterol, and LDL difered between the two groups. Similarly, in patients who rebled within 1 year, their clinical baseline variables such as time to follow-up, liver stifness measurements, portal vein diameter, use of NSBB drugs, hemoglobin, white blood cell count, platelet count, glutamyl transpeptidase, and low-density lipoprotein difered in the two groups.
Notably, at two diferent time points, clinical baseline variables such as liver stifness measurements and portal vein diameter were higher in the rebleeding group than in the nonrebleeding group. However, clinical variables such as follow-up time, the proportion of patients on NSBB drugs, hemoglobin, platelet count, glutamyl transpeptidase, and LDL were lower in the rebleeding group than in the nonrebleeding group.

Development and Validation of Logistic Regression
Models. We investigated clinical variables associated with variceal rebleeding within the 6 weeks in a univariate logistic regression analysis using enter methods to include all clinical baseline variables. Tis process identifed 9 clinical variables such as liver stifness measurements, portal vein diameter, use of NSBB drugs, hemoglobin, platelet count, alkaline phosphatase, cholesterol, and LDL associated with variceal rebleeding. Ten, we included the abovementioned 9 variables in a multivariate logistic regression and identifed 3 variables, the use of NSBB drugs (OR: 0.170 (0.062-0.470), P � 0.01), hemoglobin (OR: 0.979 (0.960-0.998), P � 0.029]), and platelets (OR: 0.985 (0.971-0.999), P � 0.032), as independent risk factors for variceal bleeding ( Table 2).
A similar approach was applied to the 1-year observation points. 7 variables, BMI, liver stifness measurement, portal vein diameter, use of NSBB drugs, hemoglobin, white blood cell count, and platelet count, were identifed in a univariate logistic regression analysis. Multifactorial logistic regression analysis identifed BMI (OR  (Table 2).
Based on the independent risk factors obtained above, we developed the nomograms (Figures 2(a) and 2(b)). Evaluating this nomogram using the R 2 and C-index and the results showed an R 2 of 0.228 and a C-index of 0.828 (0.761-0.896) for the model in predicting rebleeding within 6 weeks. Similarly, in the nomogram predicting rebleeding within 1 year, the R 2 and C indices were 0.286 and 0.799 (0.738-0.859), respectively. To further evaluate the model, the accuracy of the model and potential model overft were assessed by bootstrap validation with 1000 resamplings, the 50-sample bootstrapped calibration plot for the prediction of 6 weeks rebleeding rate and 1-year rebleeding rate (Figures 2(c) and 2(d)). Te calibration plots demonstrated excellent consistency between the actual rebleeding rate and the nomogram prediction.

Development and Validation of XGBoost Models.
We developed XGBoost models for rebleeding within 6 weeks and rebleeding within 1 year. In the model for predicting rebleeding within six weeks, the top fve relative importance features were aspartate aminotransferase, use of NSBB drugs, liver stifness measurement, prothrombin time, and blood creatinine level. Similarly, in the model predicting rebleeding within 1 year, the top fve relatively important features were liver stifness measurements, age, blood creatinine, platelet count, and urea nitrogen levels (Figures 3(a)  and 3(b)). SHAP analysis values were calculated to compute the contribution of each parameter to the performance of the prediction model. It showed that the top fve features were aspartate aminotransferase, use of NSBB drugs, liver stifness measurements, blood creatinine, and hemoglobin levels in       Other parameters used to evaluate the model such as sensitivity, specifcity, accuracy, precision, recall, and F1 are detailed in the Table 3.
To visualize the abovementioned results, we developed a nomogram based on traditional logistic regression models to predict rebleeding within 6 weeks and 1 year. Plotting the DCA curves for the logistic regression model and the XGBoost model ( Figure 5), it can be visually learned that the net beneft of the XGBoost model is consistently higher than that of the logistic regression model at both time points, which means the XGBoost model is the optimal and the logistic regression model inferior.

Discussion
In this study, we developed the traditional logistic regression model and the XGBoost algorithm model using common clinical indicators and our study has several novel contributions. For the frst time, our study included the XGBoost algorithms' model for comprehensive analyses and compared their predictive performance with the traditional logistic regression model. Whether it is evaluated from the model performance parameters or from the DCA curve to evaluate the patient's net beneft, the results suggest that the XGBoost algorithm model performs better than the traditional LR model. Such results are promising, and this model has the potential to be integrated into electronic medical records and made available in healthcare settings.
In an LR model to predict rebleeding within 6 weeks and 1 year, the presence or absence of NSBB used, platelet count, and hemoglobin were established as common independent risk factors. Te guidelines recommend the use of NSBB drugs for secondary prevention of variceal rebleeding [11]. NSBB drugs have been reported not only in secondary prophylaxis but also in the prevention of primary variceal bleeding [13]. Of the predictors of esophageal varices and variceal bleeding in patients with acute upper gastrointestinal bleeding, platelets appear to diferentiate between patients with and without esophageal varices [14] and predict patient mortality and rebleeding rates [15]. Interestingly, hemoglobin levels predicted rebleeding in patients at 6 weeks and 1 year. On the one hand, splenic phagocytic activity may lead to anemia and leukopenia in cirrhotic splenomegaly, and other more intricate factors lead to thrombocytopenia [16]. On the other hand, Piano et al. [17] found that baseline hemoglobin levels were an independent risk factor for the development of ACLF. Te underlying pathophysiological mechanism can be explained by the fact that low hemoglobin concentrations may further reduce peripheral oxygen delivery, either directly and/or by further impairing macrovascular dysfunction, thereby exacerbating the development of organ failure.
Currently, LSM are promising predictors of progression of compensated cirrhosis to decompensation and predictors of progression of decompensated cirrhosis and are widely validated worldwide [11,[18][19][20]. Mechanistically, LSM has a good consistency with the degree of liver tissue fbrosis and portal pressure, while PH is the result of liver cirrhosis and is an important determinant of EVB disease course and prognosis [21]. Previous studies [19] have indicated that LSM predicts survival in NAFLD. For that matter, similar results were obtained in our study, where LSM predicted rebleeding over a relatively long time, within one year, in the    International Journal of Clinical Practice traditional logistic regression model and the XGBoost algorithm model. Interestingly, LSM was not an independent risk factor in the LR model for predicting rebleeding within 6 weeks. A potential explanation is that LSM is positively related to the degree of liver fbrosis, but it is not a simple linear relationship [22]. In logistic regression analysis, handling such variables and screening is indeed inferior to machine learning models.
To facilitate the implementation and interpretation of the XBGoost model in clinical practice, SHAP analysis, which is a new way to describe the contribution of the predictor's value to the overall prediction of an individual in the XGBoost model, was used for this model. In the XGBoost model for predicting rebleeding within 6 weeks, AST and creatinine levels were both presents in the frst fve items of the SHAP analysis. Te abovementioned results suggest that patients with liver [23] and kidney injury [24] are more likely to have rebleeding within 6 weeks. From another perspective, the use of AST with platelet ratio index (APRI) for the noninvasive diagnosis of clinically signifcant portal hypertension and esophageal varices has been reported for a long time [25], implying that this parameter plays an important role in predicting rebleeding. In the XGBoost model for predicting rebleeding within 1 year, LSM was the feature that contributed the most to predicting rebleeding. Tis result is not astonishing, as LSM is not only associated with a good correlation with HVPG [26] but also with its ability to predict liver failure in patients with cirrhosis [17,27].
In our study, when comparing patients in the bleeding group with those in the nonbleeding group at baseline, LDL levels were found to be signifcantly lower in patients in the bleeding group than in the nonbleeding group. Xiao et al. [28] found that reduced serum LDL levels were an independent risk factor for survival in patients with HBVassociated ACLF. In this regard, our study expands the predictive disease spectrum of LDL and reveals the potential value of LDL not only in ACLF but also in cirrhotic    rebleeding. One of the mechanisms of variceal bleeding in cirrhosis can be explained by infammation and intestinal bacterial translocation [29]. Previous studies suggest that lipoproteins are required to bind endotoxins caused by intestinal bacterial translocation and to reduce the systemic release of proinfammatory cytokines [30]. Terefore, a decrease in LDL levels and an increase in systemic infammation in patients are not inconsistent with a tendency to develop variceal bleeding. In addition to this, reduced LDL levels may also simply be the result of liver failure, which is the main source of LDL. A noteworthy fnding in our study is that the features included in the XGBoost model and the logistic regression model show consistency, indicating that the superior performance of the XGBoost model is signifcant, although the two models ft well and performance may difer. Te strengths of this study lie mainly in the frst use of the XGBoost model to predict esophageal variceal rebleeding in patients with hepatitis B-related cirrhosis, which was compared with conventional regression analysis and validated by calibration curves and DCA curves. We acknowledge other limitations of our study: frst, potential bias may occur due to data from a single center, although our unit is the largest health care facility in our region; second, the proposed model was not validated by other centers or databases; and third, no follow-up measurements of patients' LSM were made during follow-up, as some studies have reported that the value of change in LSM predicts prognosis of patients with postviral hepatitis cirrhosis [31]. Even so, we believe that the proposed model may help us to further understand the prognosis of such patients.
In conclusion, this study shows that machine learning based on the XGBoost algorithm is indeed superior to traditional logistic regression. Meanwhile, LSM proved to be a promising parameter for predicting variceal rebleeding in patients. Tis would mean transplanting the XGBoost model into an electronic patient management system to scientifcally predict the risk of rebleeding and provide personalized care to patients.

Data Availability
Te data used to support the fndings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest
Te authors declare that they have no conficts of interest.